package com.qdlc.p2p.dal.dao;

import com.qdlc.p2p.dal.common.model.jpa.PageDataList;
import com.qdlc.p2p.dal.dto.CashAwardRule;
import com.qdlc.p2p.dal.model.CashAwardRuleModel;

import java.util.List;

/**
 * 现金奖励规则DAO接口
 *
 * @author Kaiju Zhao
 * @date 2016-3-23
 */
public interface CashAwardRuleDao {

    /**
     * 分页获取现金奖励规则信息
     *
     * @author Kaiju Zhao
     * @param model 现金奖励规则model
     * @return 现金奖励规则分页信息
     */
    PageDataList<CashAwardRuleModel> list(CashAwardRuleModel model);

    /**
     * 修改现金奖励规则的状态
     *
     * @author Kaiju Zhao
     * @param model 现金奖励规则model
     * @return
     */
    int toggleStatus(CashAwardRuleModel model);

    /**
     * 新增
     *
     * @author Kaiju Zhao
     * @param model 现金奖励规则model
     * @return
     */
    int save(CashAwardRule cashAwardRule);

    /**
     * 查找
     *
     * @author Kaiju Zhao
     * @param model 现金奖励规则model
     * @return
     */
    CashAwardRule find(long id);

    /**
     * 更新
     *
     * @author Kaiju Zhao
     * @param model 现金奖励规则model
     * @return
     */
    int update(CashAwardRule cashAwardRule);

    /**
     * 根据状态查找List对象
     *
     * @author Kaiju Zhao
     * @param model 现金奖励规则model
     * @return
     */
    List<CashAwardRule>  findByStatus(int status);

}
